import Storage from '../../Storage.js';


export function getCachedContext(key) {
    let ctx = Storage.getCacheStorage('CACHED_CTX').get(key);
    if (!ctx) {
        let canvas = document.createElement('canvas');
        ctx = canvas.getContext('2d');
        Storage.getCacheStorage('CACHED_CTX').set(key, ctx);
    }
    return ctx;
}
